#pragma once

#include "OpCode.h"

enum GameServer2MapInstance
{
	GS2MI_MESSAGE_NONE = GAME_OPCODE::CSMSG_COUNT,

	G2M_INITIALIZE_INSTANCE,  // `instance`

	G2M_CHARACTER_TELEPORT_BEGIN_ENTER_INSTANCE_CANCEL,  // `instance`
	G2M_CHARACTER_TELEPORT_FAILED,  // `player`
	G2M_CHARACTER_ENTER_MAP,  // `instance`
	G2M_CHARACTER_LEAVE_MAP,  // `player`
	G2M_CHARACTER_LOGOUT_GAME,  // `instance`

	G2M_TEAM_INFO,  // `instance`
	G2M_TEAM_MEMBER_ADD,  // `instance`
	G2M_TEAM_MEMBER_QUIT,  // `instance`
	G2M_TEAM_LEADER_CHANGE,  // `instance`
	G2M_TEAM_DISBAND,  // `instance`

	G2M_TRY_GUILD_CREATE,  // `rpc,player`
	G2M_GUILD_CREATE_RESP,  // `rpc,player`
	G2M_JOIN_GUILD_EVENT,  // `player`
	G2M_QUIT_GUILD_EVENT,  // `player`

	G2M_GET_CHAT_MESSAGE_THING,  // `rpc,player`
	G2M_BUY_SPECIAL_SHOP_ITEM,  // `rpc,player`

	G2M_GET_OPERATING_REWARD_ITEMS,  // `rpc,player`

	G2M_PLAYBOSS_STRIKE,  // `instance`
	G2M_PLAYBOSS_DEAD,  // `instance`
	G2M_PLAYBOSS_STOP,  // `instance`

	GS2MI_MESSAGE_COUNT,
};

enum GateServer2GameServer
{
	GATE2GAME_MESSAGE_NONE,

	CGG_REGISTER,
	SGG_REGISTER_RESP,

	FLAG_GATE2GAME_MSG_NEED_REGISTER_BEGIN,

	CGG_TRANS_CLIENT_PACKET,
	SGG_TRANS_CLIENT_PACKET,  // `ignore`

	SGG_ADD_MAP_SERVER,
	SGG_REMOVE_MAP_SERVER,

	SGG_PUSH_SERVER_ID,
	SGG_PUSH_SOCIAL_LISTEN,
	SGG_PUSH_PACKET_TO_ALL_CLIENT,

	CGG_ACCOUNT_LOGIN_SUCC,
	CGG_ACCOUNT_LOGOUT,
	SGG_KICK_ACCOUNT,
	SGG_KILL_ACCOUNT,
	SGG_PUSH_CHARACTER,
	SGG_PUSH_PLAYER,

	GATE2GAME_MESSAGE_COUNT,
};

enum GateServer2MapServer
{
	GATE2MAP_MESSAGE_NONE,

	CGM_REGISTER,
	SGM_REGISTER_RESP,

	FLAG_GATE2MAP_MSG_NEED_REGISTER_BEGIN,

	CGM_TRANS_PLAYER_PACKET,  // `ignore`
	SGM_TRANS_CLIENT_PACKET,  // `ignore`

	CGM_TRANS_INSTANCE_PACKET,  // `ignore`
	SGM_TRANS_MAP_SERVER_PACKET,  // `ignore`

	SGM_TRANS_SOCIAL_SERVER_PACKET,  // `ignore`

	SGM_PUSH_PACKET_TO_ALL_CLIENT,

	GATE2MAP_MESSAGE_COUNT,
};

enum MapServer2GameServer
{
	MAP2GAME_MESSAGE_NONE,

	MS_REGISTER,
	GS_REGISTER_RESP,

	FLAG_MAP2GAME_MSG_NEED_REGISTER_BEGIN,

	MS_RPC_INVOKE_RESP,  // `ignore`
	GS_RPC_INVOKE_RESP,  // `ignore`

	GS_TRANS_INSTANCE_PACKET,  // `ignore`
	GS_TRANS_PLAYER_PACKET,  // `ignore`

	GS_TRANS_CROSS_SERVER_PACKET,  // `ignore`

	MS_TO_SOCIAL_SERVER_PACKET,

	GS_PUSH_SERVER_ID,

	MS_KICK,
	MS_CHARACTER_SAVED,
	MS_UPDATE_CHARACTER_INFO,

	GS_START_WORLD_MAP,
	GS_START_INSTANCE,
	GS_STOP_INSTANCE,

	MS_SWITCH_MAP,
	GS_CHARACTER_TELEPORT_BEGIN_ENTER_INSTANCE,
	MS_CHARACTER_TELEPORT_BEGIN_ENTER_INSTANCE_RESULT,
	MS_CHARACTER_ENTER_MAP_RESP,
	MS_CHARACTER_LEAVE_MAP_RESP,

	MS_UPDATE_ACTIVITY_OBJECT_POSITION,
	MS_QUERY_ACTIVITY_OBJECT_POSITION,  // `rpc`

	MS_MAP_TEAM_CREATE,
	MS_MAIL,

	GS_SYNC_PLAYER_LEVEL_MAX,
	GS_SYNC_OPERATING_CARES,

	MS_FINISH_GUILD_LEAGUE,

	MAP2GAME_MESSAGE_COUNT,
};

enum MapServer2CrossServer
{
	MAP2CROSS_MESSAGE_NONE,

	SMC_TRANS_INSTANCE_PACKET,  // `ignore`
	SMC_TRANS_PLAYER_PACKET,  // `ignore`
	SMC_TRANS_CLIENT_PACKET,  // `ignore`
	SMC_TRANS_GAME_SERVER_PACKET,  // `ignore`

	CMC_RPC_INVOKE_RESP,  // `ignore`
	SMC_RPC_INVOKE_RESP,  // `ignore`

	SMC_START_INSTANCE,
	SMC_STOP_INSTANCE,

	SMC_QUERY_PLAYER_LEVEL_MAX,  // `rpc`

	CMC_PLAYBOSS_CHANGE_TEAM,
	CMC_PLAYBOSS_BROADCAST,
	CMC_PLAYBOSS_STRIKE,
	CMC_PLAYBOSS_SYNC,
	CMC_PLAYBOSS_JOIN,

	MAP2CROSS_MESSAGE_COUNT,
};

enum GateServer2SocialServer
{
	GATE2SOCIAL_MESSAGE_NONE,

	CGT_REGISTER,
	SGT_REGISTER_RESP,

	FLAG_GATE2SOCIAL_MSG_NEED_REGISTER_BEGIN,

	CGT_TRANS_SERVER_PACKET,  // `ignore`
	CGT_TRANS_CLIENT_PACKET,  // `ignore`
	SGT_TRANS_CLIENT_PACKET,  // `ignore`

	CGT_UPDATE_GS_GATE_SN,

	SGT_PUSH_PACKET_TO_ALL_CLIENT,

	GATE2SOCIAL_MESSAGE_COUNT,
};

enum GameServer2SocialServer
{
	GAME2SOCIAL_MESSAGE_NONE,

	CGX_REGISTER,
	SGX_REGISTER_RESP,

	FLAG_GAME2SOCIAL_MSG_NEED_REGISTER_BEGIN,

	CGX_BROADCAST_SERVICES,  // `ignore`

	CGX_RPC_INVOKE_RESP,  // `ignore`
	SGX_RPC_INVOKE_RESP,  // `ignore`

	SGX_TO_ALL_MAP_SERVER_PACKET,
	SGX_TO_MAP_SERVER_INSTANCE_PACKET,
	SGX_TO_MAP_SERVER_PLAYER_PACKET,
	SGX_TO_INSTANCE_PACKET,
	SGX_TO_PLAYER_PACKET,

	CGX_PUSH_SERVER_ID,

	SGX_KICK,

	CGX_RESTORE_CHARACTERS,
	CGX_CHARACTER_ONLINE,
	CGX_CHARACTER_OFFLINE,

	CGX_UPDATE_GAME_SERVER,  // `s2guild,s2rank`
	CGX_UPDATE_CHARACTER_INFO,  // `s2guild`

	SGX_PULL_CHARACTER_INFOS,  // `rpc`
	CGX_PULL_GUILD_INFOS,  // `rpc,s2guild`

	CGX_GET_ALL_GUILDS,  // `s2guild`
	SGX_PUSH_ALL_GUILDS,
	CGX_GET_ALL_CHARACTER_GUILDS,  // `s2guild`
	SGX_PUSH_CHARACTER_GUILDS,
	SGX_CHARACTER_JOIN_GUILD,
	SGX_CHARACTER_QUIT_GUILD,

	CGX_TRY_GUILD_CREATE,  // `rpc,s2guild`
	CGX_GUILD_CREATE,  // `rpc,s2guild`
	CGX_GUILD_INVITE,  // `s2guild`
	CGX_GUILD_INVITE_RESP,  // `s2guild`
	CGX_GUILD_APPLY,  // `s2guild`
	CGX_GUILD_APPLY_RESP,  // `s2guild`
	CGX_GUILD_LEAVE,  // `s2guild`
	CGX_GUILD_KICK,  // `s2guild`
	CGX_GUILD_RISE,  // `s2guild`
	CGX_GUILD_DISBAND,  // `rpc,s2guild`
	CGX_GUILD_GET_APPLY,  // `s2guild`

	CGX_RANK_NEW_PLAYER,  // `s2rank`
	CGX_RANK_UPDATE_PLAYER,  // `s2rank`
	CGX_RANK_REMOVE_PLAYER,  // `s2rank`
	CGX_RANK_NEW_GUILD,  // `s2rank`
	CGX_RANK_UPDATE_GUILD,  // `s2rank`
	CGX_RANK_REMOVE_GUILD,  // `s2rank`

	CGX_RANK_GET_GUILD_RANK_VALUE,  // `rpc,s2rank`
	CGX_RANK_GET_GUILD_ID_LIST,  // `rpc,s2rank`

	CGX_OPERATING_GET_LIST,  // `s2operating`
	CGX_OPERATING_GET_DETAIL,  // `s2operating`
	CGX_OPERATING_GET_SHORT_HOT,  // `s2operating`
	CGX_OPERATING_BUY,  // `s2operating`
	CGX_OPERATING_GET_REWARD,  // `s2operating`
	CGX_OPERATING_LOGIN,  // `s2operating`
	CGX_OPERATING_PAY,  // `s2operating`
	CGX_OPERATING_COST,  // `s2operating`
	CGX_OPERATING_GAIN_SCORE,  // `s2operating`
	CGX_OPERATING_PLAY_ACTVT,  // `s2operating`
	CGX_OPERATING_EVENT_ACTVT,  // `s2operating`
	SGX_SAVE_LAST_OPERATING_EVENT_TIME,
	SGX_SEND_OPERATING_REWARD_MAIL,
	SGX_SYNC_OPERATING_CARES,

	GAME2SOCIAL_MESSAGE_COUNT,
};
